despair inwardly

Translations
отчаиваться внутренне
He would despair inwardly but try to stay strong on the outside.
Он отчаивался внутренне, но старался оставаться сильным снаружи.